package com.sikaryofficial.backend.domain.dto.req.productactivity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.sikaryofficial.common.core.annotation.CustomerDateDeserializer;
import com.sikaryofficial.system.api.model.att.AttachmentResp;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Min;
import java.util.Date;
import java.util.List;

/**
 * @author : qinjinyuan
 * @desc : 活动保存对象
 * @date : 2023/11/21 19:30
 */
@Getter
@Setter
@ToString
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(description = "活动保存对象")
public class ActivityReq {

    /**
     * 是否用于预览
     */
    @ApiModelProperty(value = "是否用于预览 true : 是",example = "false")
    private boolean useInPreView;

    /**
     * 活动ID
     */
    @ApiModelProperty(value = "活动ID",example = "1111")
    private Long activityId;

    /**
     * 活动名称
     */
    @ApiModelProperty(value = "活动名称")
    @Length(min = 1, max = 30, message = "activity name could not less than 1 and greater than 30")
    private String activityName;

    /**
     * 活动描述
     */
    @ApiModelProperty(value = "活动描述")
    @Length(min = 1, max = 4000, message = "activity desc could not less than 1 and greater than 4000")
    private String activityDesc;

    /**
     * 活动开始时间
     */
    @ApiModelProperty(value = "活动开始时间", example = "2023-11-21 19:30:00")
    @JsonDeserialize(using = CustomerDateDeserializer.class)
    private Date startTime;

    /**
     * 活动结束时间
     */
    @ApiModelProperty(value = "活动结束时间", example = "2023-11-22 19:30:00")
    @JsonDeserialize(using = CustomerDateDeserializer.class)
    private Date endTime;

    /**
     * 1-purchase 抢购 2-lottery 抽奖 3-xxx
     */
    @ApiModelProperty(value = "1-purchase 抢购 2-lottery 积分抽奖(幸运大转盘)  3-积分抽奖(刮刮乐)  4-xxx 积分抽奖-定时开奖，预约立即参与活动，中奖邮件通知")
    private Integer activityType;

    /**
     * 国家
     */
    @ApiModelProperty(value = "国家")
    private String country;

    /**
     * 城市
     */
    @ApiModelProperty(value = "城市", example = "Barnsley")
    private String city;

    /**
     * 区域
     */
    @ApiModelProperty(value = "区域", example = "England")
    private String area;

    /**
     * 活动是否上架（生效）0-否 1-是
     */
    @JsonIgnore
    private Integer hasEffect;

    /**
     * 是否线上活动 0-线上 1-线下，默认线上活动
     */
    @ApiModelProperty(value = "是否线上活动 0-线上 1-线下，默认0-线上活动")
    private Integer hasOnline;

    /**
     * 是否推荐首页 0-否 1-是，默认0
     */
    @ApiModelProperty(value = "是否推荐首页 0-否 1-是，默认0")
    private Integer hasHomepage;

    @ApiModelProperty(value = "活动封面图片")
    private String coverUrl;

    /**
     * 积分个数
     */
    @ApiModelProperty(value = "参与积分")
    private Integer points;

    /**
     * 参与次数
     */
    @ApiModelProperty(value = "参与次数")
    @Min(value = 1, message = "参与次数不能小于1")
    private Integer attendNumber;

    /**
     * 地址ID
     */
    @ApiModelProperty(value = "地址ID")
    private Long addressId;
    /**
     * 活动(平台)品牌
     */
    @ApiModelProperty(value = "活动(平台)品牌")
    private String activityBrand;

    /**
     * 租户号
     */
    @JsonIgnore
    private Integer tenantId;

    @ApiModelProperty(value = "活动附件列表")
    private List<AttachmentResp> attachmentList;
}
